//
//  JTool.m
//  PigMarket
//
//  Created by mac on 2019/3/28.
//  Copyright © 2019 felix.pigmarket.oc. All rights reserved.
//

#import "JTool.h"

@implementation JTool

+ (float)getScreenWidthScale {
    return SCREEN_WIDTH / 375.0;
}
/**
*  判空
*
*  @param object 任意id类型
*
*  @return BOOL值
*/
+ (BOOL)iSNull:(id)object
{
    if (([object isEqual:[NSNull null]]) || (object == nil) || (object == NULL))
    {
        return YES;
    }
    if ([object isKindOfClass:[NSString class]])
    {
        return [self isEmptyInput:object];
    }
    return NO;
}

/**
 *  输入合法性检查
 *
 *  @param txt 字符串
 *
 *  @return BOOL值
 */
+ (BOOL)isEmptyInput:(NSString *)txt
{
    if(txt==nil)
    {
        return YES;
    }
    txt=[txt stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];
    return [txt isEqualToString:@""];
}
@end
